<?php
/**
* index.php
*
* Controler. Invoke concrete Page base on cmd.
*
* @author     Blazej Zieba <b@zieba.info>
* @copyright  2007 konekto.com
* @version    CVS: $Id:$
*
*
*/


require_once("framework/config.php");
require_once("framework/UserErrorHandler.class.php");
require_once("framework/ExceptionHandler.class.php");
require_once("Redirect.class.php");
require_once("framework/localization.php");
require_once("framework/PageFactory.php");

$global = &PEAR::getStaticProperty("CONFIG_INI","GLOBAL");

if ( $page = &getPage( $global["default_page"] ) )
{
        $debug = &PEAR::getStaticProperty("CONFIG_INI","DEBUG");
        
        if ($debug["remove_whitespace"] == "1" )
        {
            echo $page->getContent();
        }
        else
        {
            echo preg_replace("/[\n\r\t]/","",$page->getContent());
        }
        
}
else
{
    trigger_error("Default page not found", E_USER_ERROR);
    die();
}

?>
